﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Dialog.Master" AutoEventWireup="true"
    CodeBehind="VariationProductEdit.aspx.cs" Inherits="NetDon.OA.Portal.Product.VariationProductEdit" %>

<%@ Register TagPrefix="uc1" TagName="RequiredMark" Src="~/Controls/RequiredMark.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" type="text/javascript">
        function deleteIssuingOrderDeliveryId(issuingOrderDeliveryId) {
            $confirm("确定要删除该子SKU吗？", function (result) {
                if (result == true) {
                    $text($get('<%=hfdIssuingOrderDeliveryId.ClientID %>'), issuingOrderDeliveryId);
                    $get('<%=btnIssuingOrderDeliveryDelete.ClientID %>').click();
                }
            });
        }


        function onChangeDeliveryCode(obj, foucsControlId, rowIndex) {
            var deliveryCode = $(obj).val();
            if (deliveryCode.trim() != "") {

                $text($get('<%=HiddenDeliveryCode.ClientID %>'), deliveryCode);
                $text($get('<%=HiddenRowIndex.ClientID %>'), rowIndex);

                setFocus(obj, foucsControlId);
                $get('<%=btnHiddenDeliveryCodeChanged.ClientID %>').click();

            }

        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <NetDon:FormPanel ID="panelCustomInfo" runat="server" CaptionAlign="NotSet" RepeatColumns="1">
        <Items>
            <NetDon:FormItem HeaderText="商品名称">
                <ContentTemplate>
                    <asp:TextBox ID="txtName" runat="server" Text='<%#Bind("Name") %>'></asp:TextBox>
                    <uc1:RequiredMark ID="RequiredMark5" runat="server" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtName"
                        Display="None" ErrorMessage="请输入商品名称" SetFocusOnError="True"></asp:RequiredFieldValidator>
                </ContentTemplate>
            </NetDon:FormItem>
            <NetDon:FormItem HeaderText="组合SKU" ColumnSpan="2">
                <ContentTemplate>
                    <asp:TextBox ID="txtSKU" runat="server" Text='<%#Bind("Sku") %>'></asp:TextBox>
                    <uc1:RequiredMark ID="RequiredMark1" runat="server" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSKU"
                        Display="None" ErrorMessage="请输入组合SKU" SetFocusOnError="True"></asp:RequiredFieldValidator>
                </ContentTemplate>
            </NetDon:FormItem>
            <NetDon:FormItem HeaderText="子SKU信息" ColumnSpan="2">
                <ContentTemplate>
                    <NetDon:GridView ID="gridCustomerInfoList" runat="server" AutoGenerateColumns="False"
                        AllowSorting="true" OnRowDataBound="gridCustomerInfoList_RowDataBound" DataKeyNames="Id"
                        CssClass="IncrementalTable" Width="300px">
                        <Columns>
                            <NetDon:IndexField HeaderText="序号">
                            </NetDon:IndexField>
                            <NetDon:TemplateField HeaderText="子SKU">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtSubSKU" Text='<%#Eval("Subsku")%>' MaxLength="50" Width="90px"
                                        runat="server"></asp:TextBox>
                                    <br />
                                </ItemTemplate>
                            </NetDon:TemplateField>
                            <NetDon:TemplateField HeaderText="下单数量">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtOrderQuantity" Text='<%#Convert.ToInt32(Eval("Quantity")).ToString("#,###")%>'
                                        runat="server" SkinID="Text50" Style="text-align: right"></asp:TextBox>
                                    <NetDon:NumericEditExtender ID="NumericEditExtender14" runat="server" MaxValue="100000"
                                        TargetControlID="txtOrderQuantity" DataMode="Integer">
                                    </NetDon:NumericEditExtender>
                                </ItemTemplate>
                            </NetDon:TemplateField>
                            <NetDon:BoundField HeaderText="库存量" DataField="StockQuantity">
                            </NetDon:BoundField>
                            <NetDon:BoundField HeaderText="商品名称" DataField="GoodsName">
                            </NetDon:BoundField>
                            <NetDon:BoundField HeaderText="规格" DataField="Spec">
                            </NetDon:BoundField>
                            <NetDon:TemplateField HeaderText="操作" ItemStyle-Width="30px">
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnDelete" runat="server" CausesValidation="false" SkinID="Delete" />
                                </ItemTemplate>
                            </NetDon:TemplateField>
                        </Columns>
                    </NetDon:GridView>
                </ContentTemplate>
            </NetDon:FormItem>
        </Items>
    </NetDon:FormPanel>
    <asp:HiddenField ID="hfdIssuingOrderDeliveryId" runat="server" />
    <asp:Button ID="btnIssuingOrderDeliveryDelete" runat="server" SkinID="Hidden" CausesValidation="false"
    OnClick="btnIssuingOrderDeliveryDelete_Click"></asp:Button>
<asp:Button ID="btnHiddenDeliveryCodeChanged" runat="server" SkinID="Hidden" CausesValidation="false"
    OnClick="txtDeliveryOrderCode_SelectedIndexChanged"></asp:Button>
    <asp:HiddenField ID="HiddenDeliveryCode" runat="server" />
<asp:HiddenField ID="HiddenRowIndex" runat="server" />
    <div style="padding-top: 10px">
        <center>
            <asp:Button ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click"></asp:Button>
            <asp:Button ID="btnReturn" runat="server" Text="退出" CausesValidation="false"></asp:Button>
            <NetDon:ValidationSummary ID="ValidationSummary2" runat="server" ShowMessageBox="true"
                ShowSummary="false" />
        </center>
    </div>
</asp:Content>
